package cn.sciento.transfer.infra.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "stong.transfer")
public class StongTransferProperties {
  public static final String PREFIX = "stong.transfer";
  
  private Boolean initCache = Boolean.FALSE;
  
  private ThreadPoolProperties threadPoolProperties;
  
  public Boolean getInitCache() {
    return this.initCache;
  }
  
  public void setInitCache(Boolean initCache) {
    this.initCache = initCache;
  }
  
  private long kafkaConsumerPollTimeout = 1000L;
  
  public static class ThreadPoolProperties {
    private int corePoolSize = 1;
    
    private int maxPoolSize = Integer.MAX_VALUE;
    
    private int keepAliveSeconds = 60;
    
    private int queueCapacity = Integer.MAX_VALUE;
    
    private boolean allowCoreThreadTimeOut = false;
    
    private String threadNamePrefix = "stong.transfer";
    
    public int getCorePoolSize() {
      return this.corePoolSize;
    }
    
    public int getMaxPoolSize() {
      return this.maxPoolSize;
    }
    
    public int getKeepAliveSeconds() {
      return this.keepAliveSeconds;
    }
    
    public int getQueueCapacity() {
      return this.queueCapacity;
    }
    
    public boolean isAllowCoreThreadTimeOut() {
      return this.allowCoreThreadTimeOut;
    }
    
    public void setCorePoolSize(int corePoolSize) {
      this.corePoolSize = corePoolSize;
    }
    
    public void setMaxPoolSize(int maxPoolSize) {
      this.maxPoolSize = maxPoolSize;
    }
    
    public void setKeepAliveSeconds(int keepAliveSeconds) {
      this.keepAliveSeconds = keepAliveSeconds;
    }
    
    public void setQueueCapacity(int queueCapacity) {
      this.queueCapacity = queueCapacity;
    }
    
    public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
      this.allowCoreThreadTimeOut = allowCoreThreadTimeOut;
    }
    
    public String getThreadNamePrefix() {
      return this.threadNamePrefix;
    }
    
    public void setThreadNamePrefix(String threadNamePrefix) {
      this.threadNamePrefix = threadNamePrefix;
    }
  }
  
  public ThreadPoolProperties getThreadPoolProperties() {
    return this.threadPoolProperties;
  }
  
  public void setThreadPoolProperties(ThreadPoolProperties threadPoolProperties) {
    this.threadPoolProperties = threadPoolProperties;
  }
  
  public long getKafkaConsumerPollTimeout() {
    return this.kafkaConsumerPollTimeout;
  }
  
  public void setKafkaConsumerPollTimeout(long kafkaConsumerPollTimeout) {
    this.kafkaConsumerPollTimeout = kafkaConsumerPollTimeout;
  }
}
